struct ListNode* removeElements(struct ListNode* head, int val) {
   if(head==NULL)
   return NULL;
   struct ListNode *p = head;
   
   
   struct ListNode *s= head->next;

   if(head!=NULL)
    while(s!=NULL)
    {
        if(s->val==val)
        {
            p->next=s->next;
            free(s);
            s=p->next;
        }
        else
        {
            p=p->next;
            s=s->next;
        }
    }
    if(head->val==val)
    {
        p=head;
        head=head->next;
        free(p);
    }
    return head;
}